package com.jxw.launcher;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.List;

/* loaded from: classes.dex */
public class AutoPollAdapter extends RecyclerView.Adapter<ViewHolder> {
    private final Context mContext;
    private final List<BookBean> mData;

    @Override // android.support.v7.widget.RecyclerView.Adapter
    public int getItemCount() {
        return Integer.MAX_VALUE;
    }

    public AutoPollAdapter(Context context, List<BookBean> list) {
        this.mContext = context;
        this.mData = list;
    }

    @Override // android.support.v7.widget.RecyclerView.Adapter
    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new ViewHolder(LayoutInflater.from(this.mContext).inflate(R.layout.item_auto_poll, viewGroup, false));
    }

    @Override // android.support.v7.widget.RecyclerView.Adapter
    public void onBindViewHolder(ViewHolder viewHolder, int i) {
        List<BookBean> list = this.mData;
        BookBean bookBean = list.get(i % list.size());
        viewHolder.imageView.setImageResource(bookBean.getImgRes());
        viewHolder.imageView.setTag(String.format(this.mContext.getResources().getString(R.string.tag_args_xdf_video), Integer.valueOf(bookBean.getBookId()), bookBean.getBookName()));
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static class ViewHolder extends RecyclerView.ViewHolder {
        ImageView imageView;

        public ViewHolder(View view) {
            super(view);
            this.imageView = (ImageView) view.findViewById(R.id.iv_book);
        }
    }
}
